package com.alibaba.csp.sentinel.dashboard.rule.nacos.param;

import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity;
import com.alibaba.csp.sentinel.dashboard.rule.nacos.AbstractDynamicPublisher;
import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 参数规则
 * @author chengjian 
 * @date 2021/7/7
 */
@Component("paramFlowRuleNacosPublisher")
public class ParamFlowRuleNacosPublisher extends AbstractDynamicPublisher<ParamFlowRuleEntity> {
    @Override
    public void publish(String app, List<ParamFlowRuleEntity> rules) throws Exception {
        publishByDataId(app, rules);
    }

    @Override
    public String ruleName() {
        return NacosConfigUtil.PARAM_FLOW_DATA_ID_POSTFIX;
    }
}
